package com.project.bean;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.project.util.SnowIdUtils;
import lombok.Data;

import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.Year;
import java.util.Date;

/**
 * 凭证明细表-子表
 */
@Data
@TableName(value = "gl_detail")
public class VoucherInfoBean {

    //凭证分录（明细表）主键
    @TableId(value = "pk_detail")
    private String pk_detail;                   //不能为null

    //辅助核算标识
    @TableField(value = "assid")
//    private String assid="1001F810000000000CG3";
    private String assid;
    //银行账户
    @TableField(value = "bankaccount")
    private String bankaccount;

    //业务系统协同号
    @TableField(value = "busireconno")
    private String busireconno;

    //票据日期
    @TableField(value = "checkdate")
    private String checkdate;

    //票据编码
    @TableField(value = "checkno")
    private String checkno;

    //结算方式
    @TableField(value = "checkstyle")
    private String checkstyle;

    //队对账标志
    @TableField(value = "contrastflag")
    private long contrastflag;

    //是否折算凭证标志
    @TableField(value = "convertflag")
    private String convertflag;


    //原币贷发生额
    @TableField(value = "creditamount")
    private String creditamount;

    //贷方数量
    @TableField(value = "creditquantity")
    private String creditquantity;

    //原币借发生额
    @TableField(value = "debitamount")
    private String debitamount;

    //借方数量
    @TableField(value = "debitquantity")
    private String debitquantity;

    //分录号
    @TableField(value = "detailindex")
    private int detailindex;

    //发生额方向
    @TableField(value = "direction")
    private String direction;                         //枚举类型C代表贷方，D代表借方
    //错误信息
    @TableField(value = "errmessage")
    private String errmessage;

    //错误信息2
    @TableField(value = "errmessage2")
    private String errmessage2;

    //标错的历史信息
    @TableField(value = "errmessageh")
    private String errmessageh;

    //汇率1
    @TableField(value = "excrate1")
    private String excrate1;

    //汇率2
    @TableField(value = "excrate2")
    private String excrate2;

    //摘要名称
    @TableField(value = "explanation")
    private String explanation;

    //辅助贷发生额
    @TableField(value = "fraccreditamount")
    private String fraccreditamount;

    //辅币借发生额
    @TableField(value = "fracdebitamount")
    private String fracdebitamount;

    //内部交易业务号
    @TableField(value = "free1")
    private String free1;
    @TableField(value = "free10")
    private String free10;
    @TableField(value = "free11")
    private String free11;
    //核销日期
    @TableField(value = "free2")
    private String free2;
    //票据类型
    @TableField(value = "free3")
    private String free3;
    //内部交易业务号
    @TableField(value = "free4")
    private String free4;
    //内部交易业务交易日期
    @TableField(value = "free5")
    private String free5;
    @TableField(value = "free7")
    private String free7;
    @TableField(value = "free8")
    private String free8;
    @TableField(value = "free9")
    private String free9;
    //本币贷发生额
    @TableField(value = "localcreditamount")
    private String localcreditamount;
    //本币借发生额
    @TableField(value = "localdebitamount")
    private String localdebitamount;
    @TableField(value = "nov")
    private int  nov;
    //对方科目
    @TableField(value = "oppositesubj")
    private String oppositesubj;
    //科目主键
    @TableField(value = "pk_accsubj")
    private String pk_accsubj;
    //内部交易单位
    @TableField(value = "pk_innercorp")
    private String pk_innercorp;
    //交易单位账簿主键
    @TableField(value = "pk_innersob")
    private String pk_innersob;
    //被冲销的分录主键
    @TableField(value = "pk_offerdetail")
    private String pk_offerdetail;

    //内部客商对方公司pk
    @TableField(value = "pk_othercorp")
    private String pk_othercorp;

    //内部客商对方公司ok——glorgbook
    @TableField(value = "pk_otherorgbook")
    private String pk_otherorgbook;

    //公司编码
    @TableField(value = "pk_sob")
    private String pk_sob;

    //折算来源凭证PK
    @TableField(value = "pk_sourcepk")
    private String pk_sourcepk;
    //单价
    @TableField(value = "price")
    private String price;

    //单据处理类
    @TableField(value = "recieptclass")
    private String recieptclass;

    //签字日期
    @TableField(value = "signdatev")
    private String signdatev;

    //凭证表主键
    @TableField(value = "pk_voucher")
    private String pk_voucher;                      //不能为null


    //作废标志
    @TableField(value = "discardflagv")
    private String discardflagv="N";                    //不能为null

    //是否删除
    @TableField(value = "dr")
    private long dr=0;

    //调整期间
    @TableField(value = "free6")
    private String free6=LocalDate.now().getMonthValue()+"";

    //是否差异凭证
    @TableField(value = "isdifflag")
    private String isdifflag="N";

    //修改标志
    @TableField(value = "modifyflag")
    private String modifyflag="YYYYYYYYYYYYYYYY";

    //会计期间
    @TableField(value = "periodv")
    private String periodv=LocalDate.now().getMonthValue()+"";

    //公司编码
    @TableField(value = "pk_corp")
    private String pk_corp="1001";


    //币种主键
    @TableField(value = "pk_currtype")
    private String pk_currtype;//------------------------

    //账簿
    @TableField(value = "pk_glbook")
    private String pk_glbook;//-------------------

    //主体
    @TableField(value = "pk_glorg")
    private String pk_glorg;//-----------------------

    //主体账簿
    @TableField(value = "pk_glorgbook")
    private String pk_glorgbook;//-----------------------

    //凭证类别主键
    @TableField(value = "pk_vouchertypev")
    private String pk_vouchertypev;//-----------------------




    //记账人
    @TableField(value = "pk_managerv")
    private String pk_managerv="";

    //制单系统
    @TableField(value = "pk_systemv")
    private String pk_systemv="XX";

    //制单日期
    @TableField(value = "prepareddatev")
    private String prepareddatev= LocalDate.now()+"";

    @TableField(value = "ts")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private String ts;  // 格式为  yyyy-mm-dd hh:mm:ss

    //记账人
    @TableField(value = "voucherkindv")
    private long voucherkindv=0;                      //不能为null

    //会计年度
    @TableField(value = "yearv")
    private String yearv= Year.now()+"";


    public VoucherInfoBean() {
    }
}
